#ifndef SAMPLE_LIGHTSPHERE_H
#define SAMPLE_LIGHTSPHERE_H

#include <detail/type_mat.hpp>
#include <detail/type_mat4x4.hpp>
#include "BaseSample.h"


//static GLfloat circularVertices[] = {
//        -0.5f, 0.5f, 0.0f,
//        -0.5f, -0.5f, 0.0f,
//        0.5f, -0.5f, 0.0f,
//        0.5f, 0.5f, 0.0f,
//};
//static GLfloat *circularColorVertices = new GLfloat[] {
//        1.0f, 0.0f, 0.0f, 1.0f,
//        1.0f, 0.0f, 0.0f, 1.0f,
//        1.0f, 0.0f, 0.0f, 1.0f,
//        1.0f, 0.0f, 0.0f, 1.0f,
//
//        1.0f, 0.0f, 0.0f, 1.0f,
//        1.0f, 0.0f, 0.0f, 1.0f,
//        1.0f, 0.0f, 0.0f, 1.0f,
//        1.0f, 0.0f, 0.0f, 1.0f,
//};

class SampleLightSphere : public BaseSample
{
public:
    static const int circularPixCount = 362;
    SampleLightSphere();
    ~SampleLightSphere();

    virtual void LoadImage(NativeImage *pImage);

    virtual void Init();

    virtual void Draw();

    virtual void Destroy();

    virtual void setParentViewSize(int w, int h);
    virtual void OnSurfaceCreated();
    virtual void OnSurfaceChanged(int width, int height);

    virtual GLfloat* createPositions();
    virtual GLfloat* createColors();
    virtual void UpdateMVPMatrix(glm::mat4 &mvpMatrix, int angleX, int angleY, float ratio);
protected:
    GLfloat* m_VerticesArray;
    GLfloat* m_ColorArray;

    GLint m_MVPMatLoc;
    glm::mat4 m_MVPMatrix;
    int m_AngleX;
    int m_AngleY;
    float m_ScaleX;
    float m_ScaleY;
};


#endif